import React from 'react';
import {Link} from 'react-router';
import {Layout, Menu, Breadcrumb, Icon} from 'antd';
import DBTable from 'components/DBTable';
import './index.less';

const calcMoney = (price) => {
  let mixed = price % 100;
  const int = (price - mixed) / 100;
  mixed = (`0${mixed}`).slice(-2);
  // return [int, mixed];
	return int + '.' +mixed;
};
/**
 * 定义sidebar组件
 */
class PayList extends DBTable {

  

  handleResult = (result) => {
    // console.log('result1', result);
    let bottomInfo = [];
    bottomInfo.push(<span key='1' className='paylist-footer'>流水总计：{result.data.total}条</span>);
    bottomInfo.push(<span key='2' className='paylist-footer'>成功放款总计：{result.data.successCount}条</span>);
    bottomInfo.push(<span key='3' className='paylist-footer'>总计放款：{calcMoney(result.data.sumMoney)}元</span>);
    bottomInfo.push(<span key='4' className='paylist-footer'>成功放款：{calcMoney(result.data.successMoney)}元</span>);
    result.data.bottomInfo = bottomInfo;
    return result;
  }

}

export default PayList;
